myVid=document.getElementById("video1");
stopButton=document.getElementById("stopButton");
muteButton=document.getElementById("muteButton");
let stopBut = false;
let a=1;
function nextVid()
{
    a++;
    if(a===5){
        a=1;
    }
    b();
    console.log("您的暴击伤害是"+Math.ceil(Math.random()*10)*999.999+"!")
myVid.src="/static/index/video"+a+".mp4"
}
function b() {
    if (a===1){
        document.getElementById("name").innerText="game";
    }
    if (a===2){
        document.getElementById("name").innerText="chat";
    }
    if (a===3){
        document.getElementById("name").innerText="tiktok";
    }
    if (a===4){
        document.getElementById("name").innerText="nba";
    }

}
function preVid()
{
    a--;
    if(a===0){
        a=3;
    }
    b();
    console.log("您的暴击伤害是"+Math.ceil(Math.random()*10)*999.999+"!")
    myVid.src="/static/index/video"+a+".mp4"
}















function enableMute()
{
    if (myVid.muted===false){
        myVid.muted=true;
        muteButton.innerText="放音"
    }else{
        myVid.muted=false;
        muteButton.innerText="静音"
    }
}
function playVid()
{
    console.log(stopBut)
    if (stopBut===false){
        myVid.pause();
        stopBut=true;
        stopButton.innerText="播放"
    }else {
        myVid.play();
        stopBut=false;
        stopButton.innerText="暂停"
    }

}


